package com.myproject.mall.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@TableName("scmall_goods")
@Schema(description = "商品信息")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Goods {
    @Schema(description = "商品ID")
    @TableId(value = "goods_id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "商品名称")
    @TableField(value = "goods_title")
    private String title;

    @Schema(description = "商品描述")
    @TableField(value = "goods_description")
    private String description;

    @Schema(description = "卖方ID")
    @TableField(value = "goods_user_id")
    private String userId;

    @Schema(description = "商品所属店铺ID")
    @TableField(value = "goods_shop_id")
    private Long shopId;

    @Schema(description = "商品所属品牌ID")
    @TableField(value = "goods_brand_id")
    private Long brandId;

    @Schema(description = "商品所属分类ID")
    @TableField(value = "goods_category_id")
    private Integer categoryId;

    @Schema(description = "商品数量")
    @TableField(value = "goods_amount")
    private Integer amount;

    @Schema(description = "商品价格")
    @TableField(value = "goods_price")
    private BigDecimal price;

    @Schema(description = "商品单位")
    @TableField(value = "goods_unit")
    private String unit;

    @Schema(description = "商品规格")
    @TableField(value = "goods_size")
    private String size;

    @Schema(description = "商品销量")
    @TableField(value = "goods_sales_volume")
    private Integer salesVolume;

    @Schema(description = "商品图片")
    @TableField(value = "goods_pictures")
    private String pictures;

    @Schema(description = "商品创建时间")
    @TableField(value = "goods_create_time")
    private LocalDateTime createTime;

    @Schema(description = "商品更新时间")
    @TableField(value = "goods_update_time")
    private LocalDateTime updateTime;
}
